home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / stevie.arc / HELP.C < prev    next >
Text File  |  1990-01-10  |  9KB  |  306 lines

  1. /*
  2.  * STevie - ST editor for VI enthusiasts.    ...Tim Thompson...twitch!tjt...
  3.  *
  4.  * Extensive modifications by:  Tony Andrews       onecom!wldrdg!tony
  5.  * Turbo C 1.5 port by: Denny Muscatelli 061988
  6.  */
  7.  
  8. #include "stevie.h"
  9.  
  10. char    *Version = "STEVIE - Version 3.10";
  11.  
  12. static    int    helprow;
  13.  
  14. #ifdef    HELP
  15.  
  16. #ifdef    MEGAMAX
  17. overlay "help"
  18. #endif
  19.  
  20. static    void    longline();
  21.  
  22. bool_t
  23. help()
  24. {
  25.  
  26. /***********************************************************************
  27.  * First Screen:   Positioning within file, Adjusting the Screen
  28.  ***********************************************************************/
  29.  
  30.     outstr(T_ED);
  31.     windgoto(helprow = 0, 0);
  32.  
  33. longline("\
  34.    Positioning within file\n\
  35.    =======================\n\
  36.       ^F             Forward screenfull             Original version by:\n\
  37.       ^B             Backward screenfull                Tim Thompson\n");
  38. longline("\
  39.       ^D             scroll down half screen\n\
  40.       ^U             scroll up half screen          Extensive hacks by:\n");
  41. longline("\
  42.       G              Goto line (end default)            Tony Andrews\n\
  43.       ]]             next function\n\
  44.       [[             previous function\n\
  45.       /re            next occurence of regular expression 're'\n");
  46. longline("\
  47.       ?re            prior occurence of regular expression 're'\n\
  48.       n              repeat last / or ?\n\
  49.       N              reverse last / or ?\n\
  50.       %              find matching (, ), {, }, [, or ]\n");
  51. longline("\
  52. \n\
  53.    Adjusting the screen\n\
  54.    ====================\n\
  55.       ^L             Redraw the screen\n\
  56.       ^E             scroll window down 1 line\n\
  57.       ^Y             scroll window up 1 line\n");
  58. longline("\
  59.       z<RETURN>      redraw, current line at top\n\
  60.       z-             ... at bottom\n\
  61.       z.             ... at center\n");
  62.  
  63.     windgoto(0, 52);
  64.     longline(Version);
  65.  
  66.     windgoto(helprow = Rows-2, 47);
  67.     longline("<Press space bar to continue>\n");
  68.     windgoto(helprow = Rows-1, 47);
  69.     longline("<Any other key will quit>");
  70.  
  71.     if ( vgetc() != ' ' )
  72.         return TRUE;
  73.  
  74. /***********************************************************************
  75.  * Second Screen:   Character positioning
  76.  ***********************************************************************/
  77.  
  78.     outstr(T_ED);
  79.     windgoto(helprow = 0, 0);
  80.  
  81. longline("\
  82.    Character Positioning\n\
  83.    =====================\n\
  84.       ^              first non-white\n\
  85.       0              beginning of line\n\
  86.       $              end of line\n\
  87.       h              backward\n");
  88. longline("\
  89.       l              forward\n\
  90.       ^H             same as h\n\
  91.       space          same as l\n\
  92.       fx             find 'x' forward\n");
  93. longline("\
  94.       Fx             find 'x' backward\n\
  95.       tx             upto 'x' forward\n\
  96.       Tx             upto 'x' backward\n\
  97.       ;              Repeat last f, F, t, or T\n");
  98. longline("\
  99.       ,              inverse of ;\n\
  100.       |              to specified column\n\
  101.       %              find matching (, ), {, }, [, or ]\n");
  102.  
  103.     windgoto(helprow = Rows-2, 47);
  104.     longline("<Press space bar to continue>\n");
  105.     windgoto(helprow = Rows-1, 47);
  106.     longline("<Any other key will quit>");
  107.  
  108.     if ( vgetc() != ' ' )
  109.         return TRUE;
  110.  
  111. /***********************************************************************
  112.  * Third Screen:   Line Positioning, Marking and Returning
  113.  ***********************************************************************/
  114.  
  115.     outstr(T_ED);
  116.     windgoto(helprow = 0, 0);
  117.  
  118. longline("\
  119.     Line Positioning\n\
  120.     =====================\n\
  121.     H           home window line\n\
  122.     L           last window line\n\
  123.     M           middle window line\n");
  124. longline("\
  125.     +           next line, at first non-white\n\
  126.     -           previous line, at first non-white\n\
  127.     CR          return, same as +\n\
  128.     j           next line, same column\n\
  129.     k           previous line, same column\n");
  130.  
  131. longline("\
  132. \n\
  133.     Marking and Returning\n\
  134.     =====================\n\
  135.     ``          previous context\n\
  136.     ''          ... at first non-white in line\n");
  137. longline("\
  138.     mx          mark position with letter 'x'\n\
  139.     `x          to mark 'x'\n\
  140.     'x          ... at first non-white in line\n");
  141.  
  142.     windgoto(helprow = Rows-2, 47);
  143.     longline("<Press space bar to continue>\n");
  144.     windgoto(helprow = Rows-1, 47);
  145.     longline("<Any other key will quit>");
  146.  
  147.     if ( vgetc() != ' ' )
  148.         return TRUE;
  149. /***********************************************************************
  150.  * Fourth Screen:   Insert & Replace, 
  151.  ***********************************************************************/
  152.  
  153.     outstr(T_ED);
  154.     windgoto(helprow = 0, 0);
  155.  
  156. longline("\
  157.     Insert and Replace\n\
  158.     ==================\n\
  159.     a           append after cursor\n\
  160.     i           insert before cursor\n\
  161.     A           append at end of line\n\
  162.     I           insert before first non-blank\n");
  163. longline("\
  164.     o           open line below\n\
  165.     O           open line above\n\
  166.     rx          replace single char with 'x'\n\
  167.     R           replace characters (not yet)\n");
  168.  
  169. longline("\
  170. \n\
  171.     Words, sentences, paragraphs\n\
  172.     ============================\n\
  173.     w           word forward\n\
  174.     b           back word\n\
  175.     e           end of word\n\
  176.     )           to next sentence (not yet)\n\
  177.     }           to next paragraph (not yet)\n");
  178. longline("\
  179.     (           back sentence (not yet)\n\
  180.     {           back paragraph (not yet)\n\
  181.     W           blank delimited word\n\
  182.     B           back W\n\
  183.     E           to end of W\n");
  184.  
  185.     windgoto(helprow = Rows-2, 47);
  186.     longline("<Press space bar to continue>\n");
  187.     windgoto(helprow = Rows-1, 47);
  188.     longline("<Any other key will quit>");
  189.  
  190.     if ( vgetc() != ' ' )
  191.         return TRUE;
  192.  
  193. /***********************************************************************
  194.  * Fifth Screen:   Misc. operations, 
  195.  ***********************************************************************/
  196.  
  197.     outstr(T_ED);
  198.     windgoto(helprow = 0, 0);
  199.  
  200. longline("\
  201.     Undo  &  Redo\n\
  202.     =============\n\
  203.     u           undo last change (partially done)\n\
  204.     U           restore current line (not yet)\n\
  205.     .           repeat last change\n");
  206.  
  207. longline("\
  208. \n\
  209.     File manipulation\n\
  210.     =================\n");
  211. longline("\
  212.     :w          write back changes\n\
  213.     :wq         write and quit\n\
  214.     :x          write if modified, and quit\n\
  215.     :q          quit\n\
  216.     :q!         quit, discard changes\n\
  217.     :e name     edit file 'name'\n");
  218. longline("\
  219.     :e!         reedit, discard changes\n\
  220.     :e #        edit alternate file\n\
  221.     :w name     write file 'name'\n");
  222. longline("\
  223.     :n          edit next file in arglist\n\
  224.     :n args     specify new arglist (not yet)\n\
  225.     :rew        rewind arglist\n\
  226.     :f          show current file and lines\n");
  227. longline("\
  228.     :f file     change current file name\n\
  229.     :ta tag     to tag file entry 'tag'\n\
  230.     ^]          :ta, current word is tag\n");
  231.  
  232.     windgoto(helprow = Rows-2, 47);
  233.     longline("<Press space bar to continue>\n");
  234.     windgoto(helprow = Rows-1, 47);
  235.     longline("<Any other key will quit>");
  236.  
  237.     if ( vgetc() != ' ' )
  238.         return TRUE;
  239.  
  240. /***********************************************************************
  241.  * Sixth Screen:   Operators, Misc. operations, Yank & Put
  242.  ***********************************************************************/
  243.  
  244.     outstr(T_ED);
  245.     windgoto(helprow = 0, 0);
  246.  
  247. longline("\
  248.     Operators (double to affect lines)\n\
  249.     ==================================\n\
  250.     d           delete\n\
  251.     c           change\n");
  252. longline("\
  253.     <           left shift\n\
  254.     >           right shift\n\
  255.     y           yank to buffer\n");
  256.  
  257. longline("\n\
  258.     Miscellaneous operations\n\
  259.     ========================\n\
  260.     C           change rest of line\n\
  261.     D           delete rest of line\n\
  262.     s           substitute chars\n");
  263. longline("\
  264.     S           substitute lines (not yet)\n\
  265.     J           join lines\n\
  266.     x           delete characters\n\
  267.     X           ... before cursor\n");
  268.  
  269. longline("\n\
  270.     Yank and Put\n\
  271.     ============\n\
  272.     p           put back text\n\
  273.     P           put before\n\
  274.     Y           yank lines");
  275.  
  276.     windgoto(helprow = Rows-1, 47);
  277.     longline("<Press any key>");
  278.  
  279.     vgetc();
  280.  
  281.     return TRUE;
  282. }
  283.  
  284. static void
  285. longline(p)
  286. char *p;
  287. {
  288.     char *s;
  289.  
  290.     for ( s = p; *s ;s++ ) {
  291.         if ( *s == '\n' )
  292.             windgoto(++helprow, 0);
  293.         else
  294.             outchar(*s);
  295.     }
  296. }
  297. #else
  298.  
  299. bool_t
  300. help()
  301. {
  302.     msg("Sorry, help not configured");
  303.     return FALSE;
  304. }
  305. #endif
  306.